function [P , p2]= DLTProjection(X,x)
dlt = [];
npt = size(X,2);
if npt ~=size(x,2)
    P= 0;
    disp('error, size(X,2)~=size(x,2)')
    return
end

for  i = 1:npt
    u = x(1,i); v = x(2,i); w = x(3,i);
    
    eqn1 =[zeros(1,4),-w*X(:,i)',v*X(:,i)'];
    eqn2 =[w*X(:,i)',zeros(1,4),-u*X(:,i)'];
    dlt=[dlt;eqn1;eqn2];
end


[ ~,~,V]=svd(dlt);

P = V(:,12);

P = reshape(P,4,3)';
P = reshape(P,1,12);
%P = linsolve(dlt,zeros(npt*2,1));